package com.qingfeng.medical.biz.order.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qingfeng.medical.biz.order.domain.entity.OrderInfo;
import com.qingfeng.medical.biz.order.domain.enums.OrderStatusEnum;
import com.qingfeng.medical.biz.order.domain.vo.OrderInfoVo;

import java.text.ParseException;
import java.time.LocalDate;

/**
 * 订单表
 *
 * @author 清风学Java
 * @date 2023-04-28 17:10:43
 */
public interface OrderInfoService extends IService<OrderInfo> {

    /**
     * 订单分页列表
     * @param orderInfoPage
     * @param patientId
     * @param orderStatus
     * @return
     */
    IPage<OrderInfo> orderInfoList(Page<OrderInfo> orderInfoPage,
                                   Long patientId,
                                   OrderStatusEnum orderStatus,
                                   Long userId);

    /**
     * 查询订单列表
     * @param orderInfoPage
     * @param orderStatus
     * @param depName
     * @param patientName
     * @param orderDate
     * @return
     */
    IPage<OrderInfo> orderList(Page<OrderInfo> orderInfoPage,
                               OrderStatusEnum orderStatus,
                               String depName,
                               String patientName,
                               LocalDate orderDate);

    /**
     * 保存订单表信息
     * @param scheduleId
     * @param patientId
     * @return
     */
    Long saveOrders(Long scheduleId, Long patientId, Long userId);

    /**
     * 取消预约
     * @param id
     * @throws ParseException
     */
    void cancelOrder(Long id) throws ParseException;

    /**
     * 查询订单信息
     * @param orderInfoPage
     * @param depId
     * @param orderDate
     * @return
     */
    OrderInfoVo findDoctorOrderInfoList(Page<OrderInfo> orderInfoPage, Long depId, LocalDate orderDate);
}

